package xu.zhi.qing.praise.dao;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import xu.zhi.qing.common.dao.BaseDao;
import xu.zhi.qing.praise.entity.Like;

import java.util.List;
import java.util.Map;

@Repository
public interface LikeDao extends BaseDao<Like> {

    /**
     * 查找点赞分享
     * @return
     */
    List<Like> findByPage(Map<String,Object> params);

    Integer countByPage(Map<String,Object> params);

    List<Like> findByShareId(@Param("shareId")Integer shareId);

    Integer countByShareId(@Param("shareId")Integer shareId);

    List<Like> findByUserId(@Param("userId")Integer userId);

    Integer countByUserId(@Param("userId")Integer userId);

    Integer countByShareIdAndUserId(@Param("shareId")Integer shareId, @Param("userId")Integer UserId);

    void deleteByShareId(@Param("shareId")Integer shareId);
}
